{extend name='admin@main'}

{block name="content"}

<form class="layui-form layui-card" action="{:request()->url()}" data-auto="true" method="post" autocomplete="off">
    <div class="layui-card-body">
        <div class="layui-form-item">
            <label class="layui-form-label label-required">工单标题</label>
            <div class="layui-input-block">
                <input name="work_desc" value='{$vo.work_desc|default=""}' required placeholder="请输入工单标题"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label label-required">服务等级</label>
            <div class="layui-input-block">
                <select class="layui-select" name="grade">
                    {foreach $Think.config.case_grade as $k=>$v}
                    {if $k neq ""}
                    {eq name='Think.get.grade' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/if}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label label-required">服务分类</label>
            <div class="layui-input-block">
                <select class="layui-select" name="categroy">
                    {foreach $Think.config.case_category as $k=>$v}
                    {if $k neq ""}
                    {eq name='Think.get.categroy' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/if}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label label-required">请选择客户</label>
            <div class="layui-input-block">
                <select class="layui-select" name="customer">
                    {foreach $Think.config.customer as $k=>$v}
                    {if $k neq ""}
                    {eq name='Think.get.customer' value='$k.""'}
                    <option selected value="{$k}">{$v}</option>
                    {else}
                    <option value="{$k}">{$v}</option>
                    {/eq}
                    {/if}
                    {/foreach}
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-xs6 layui-col-sm6 layui-col-md4">
                    <label class="layui-form-label label-required">联系人</label>
                    <div class="layui-input-block">
                        <select class="layui-select" name="contact_people" placeholder="联系人">
                            {foreach $Think.config.contact_people as $k=>$v}
                            {if $k neq ""}
                            {eq name='Think.get.contact_people' value='$k.""'}
                            <option selected value="{$k}">{$k}</option>
                            {else}
                            <option value="{$k}">{$k}</option>
                            {/eq}
                            {/if}
                            {/foreach}
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label label-required">服务内容</label>
            <div class="layui-input-block">
                <textarea name="work_content" placeholder="请输入服务内容" class="layui-textarea">{$vo.work_content|default=''|raw}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <label class="layui-form-label label-required">服务时间</label>
                <div class="layui-input-block">
                    <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                        <input type="text" data-date-input="datetime" data-date-format="yyyy-MM-dd HH:mm"
                               name="work_start" value='{$vo.work_start|default=""}' placeholder="开始时间"
                               class="layui-input">
                    </div>
                    <div style="float: left;width: 15px;text-align: center;height: 38px;line-height: 38px;">-</div>
                    <div class="layui-col-xs6 layui-col-sm6 layui-col-md3">
                        <input type="text" data-date-input="datetime" data-date-format="yyyy-MM-dd HH:mm"
                               name="work_end" value='{$vo.work_end|default=""}' placeholder="结束时间"
                               class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">服务备注</label>
            <div class="layui-input-block">
                <input name="remark" value='{$vo.remark|default=""}'
                       placeholder="服务备注" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">专家支持</label>
            <div class="layui-input-block">
                <input name="support_name" value='{$vo.support_name|default=""}'
                       placeholder="专家名" class="layui-input">
            </div>
        </div>
    </div>

    <div class="hr-line-dashed"></div>
    {notempty name='vo.work_id'}<input type='hidden' value='{$vo.work_id}' name='work_id'>{/notempty}

    <div class="layui-form-item text-center" style="padding-bottom: 30px;">
        <button class="layui-btn" type='submit'>保存数据</button>
        <button class="layui-btn layui-btn-danger" type='button' onclick="history.go(-1)">返回</button>
    </div>
</form>

{/block}

{block name='script'}
<script>
    window.form.render();
    require(['ckeditor', 'angular'], function () {
        window.createEditor('[name="work_content"]', {height: 250});
    })
</script>
{/block}